import React, {FC, useEffect} from "react";
import { useNavigate} from "react-router-dom";
import {Button, ConfigProvider, Input, Space, theme, Typography} from 'antd';
import {MANAGE_LIST_PATH} from "../../router";
import styles  from "./Home.module.scss"
import axios from "axios";


//mock
// import "../../_mock/index"

const Home : FC =()=>{

    const {Title,Paragraph} = Typography;


    const nav = useNavigate();
    //useNa 是一个第三方的hook

    // useEffect(()=>{
    //      console.log("jexax")
    //     axios.get('/api/test')
    //         .then(response => {
    //             console.log(response.data);
    //         })
    //         .catch(error => {
    //             console.error(error+"没哈皮");
    //         });
    // },[])

    function clickHandler(){
         nav("/login");
    }

    return(
        <div className={styles.container}>
          {/*<p>首页*/}
          {/*</p>*/}
          {/*  <Button onClick={clickHandler} type="primary" >登入</Button>*/}
          {/*  &nbsp;*/}
          {/*  <Link to="/register">注册</Link>*/}
          <div className={styles.info}>
              <Title>调查问卷 | 投票</Title>
              <Paragraph>已累计的调查问卷数量为100份，已投票的调查问卷为20份</Paragraph>
              <div>
                  <Button type={"primary"} onClick={()=>{nav(MANAGE_LIST_PATH)}}>开始使用</Button>
              </div>
          </div>

        </div>
    );
}
export default Home;